package com.ruipengkj.component;

import java.awt.Component;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

public class JPanelBoxLayoutComponent extends JPanel {

	private static final long serialVersionUID = 1L;
	public JPanelBoxLayoutComponent(int axis) {
		//super();
		BoxLayout boxLayout = new BoxLayout(this, axis);
		this.setLayout(boxLayout);
		this.setOpaque(false);
	}
	
	public JPanelBoxLayoutComponent(Component comp, int axis) {
		//super();
		BoxLayout boxLayout = new BoxLayout(this, axis);
		this.setLayout(boxLayout);
		this.setOpaque(false);
		this.add(comp);
	}
	
	public JPanelBoxLayoutComponent(Component[] comp, int axis) {
		//super();
		BoxLayout boxLayout = new BoxLayout(this, axis);
		this.setLayout(boxLayout);
		this.setOpaque(false);
		int length = comp.length;
		for(int i = 0; i < length; ++i) {
			this.add(comp[i]);
		}
	}
}
